package com.windsea.relationshipmining.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.text.method.ScrollingMovementMethod;
import android.view.KeyEvent;
import android.widget.TextView;

import com.windsea.relationshipmining.R;

public class HelpActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_help);
		TextView tv = (TextView) findViewById(R.id.mainHelpTextView);
		TextView tvYoutube = (TextView) findViewById(R.id.textViewYoutube);
		tvYoutube
				.setText(Html
						.fromHtml("<a href=\"http://www.youtube.com/watch?v=kdYsRiQ9xmc\">Video hướng dẫn</a>"));
		tvYoutube.setMovementMethod(LinkMovementMethod.getInstance());
		tv.setMovementMethod(new ScrollingMovementMethod());
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if ((keyCode == KeyEvent.KEYCODE_BACK)) {
			finish();
			Intent intent = new Intent(getBaseContext(), MainActivity.class);
			startActivity(intent);
		}
		return super.onKeyDown(keyCode, event);
	}

}
